<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="menu/swimbi.css" />
<link rel="stylesheet" href="position/positionTable.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="menu/sidebar.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JT HR</title>

<style>
.view {
	background: url();
	width: 24px;
	height: 24px;
	border: none;
}

.view:hover{
	opacity: 0.5;
}

.view:active{
	opacity: 0.3;
}

.edit {
	background: url();
	width: 24px;
	height: 24px;
	border: none;
}

.edit:hover{
	opacity: 0.5;
}

.edit:active{
	opacity: 0.3;
}

.clone {
	background: url();
	width: 24px;
	height: 24px;
	border: none;
	margin-left: 5px;
}

.clone:hover{
	opacity: 0.5;
}

.clone:active{
	opacity: 0.3;
}

.delete {
	background: url();
	width: 19px;
	height: 24px;
	border: none;
	margin-left: 5px;
}

.delete:hover{
	opacity: 0.5;
}

.delete:active{
	opacity: 0.3;
}

.addCandidate {
	background: url();
	width: 24px;
	height: 24px;
	border: none;
	margin-left: 5px;
}

.addCandidate:hover{
	opacity: 0.5;
}

.addCandidate:active{
	opacity: 0.3;
}

tr:hover {
    background-color: #8b2d4b;   
}

</style>

</head>
<body>
	<div id="main">
		<%@ include file="header.jsp" %>
		<%@ include file="menu.jsp"%>

		<div id="site_content">
			<div id="table_container">
				<div class="CSSTable">
					<table>
						<tr>
							<td>Position Name</td>
							<td>Places A/C/T</td>
							<td>Department</td>
							<td>Project</td>
							<td>Requirements</td>
							<td>Responsibilities</td>
							<td>Approved</td>
							<td>Closed</td>
							<td>Created by</td>
							<td>Operations</td>
						</tr>
						<c:forEach items="${poz}" var="position">
							<tr>
								<td><c:out value="${position.name}"></c:out></td>
								<td><c:out value="${position.nrOfPlaces}" />/<c:out value="${fn:length(position.candidates)}" /></td>
								<td><c:out value="${position.department.departName}" /></td>
								<td><c:out value="${position.project.projectName}" /></td>
								<td><c:out value="${position.requirements}" /></td>
								<td><c:out value="${position.responsibilities}" /></td>
								<td><c:out value="${position.isApproved}" /></td>
								<td><c:out value="${position.isClosed}" /></td>
								<td><c:out value="${position.creator.firstName}" /> <c:out value="${position.creator.lastName}" /></td>
								<td>
									<div style="text-align:center;">
									<form action="position" method="POST">
										<input type="hidden" name="position_id" value="<c:out value="${position.id}" />"/>
										<input type="submit" name="viewPosition" value="" class="view" title="View" />
										
										<c:if test="${position.isClosed == false and position.isApproved == true}">
	 										<input type="submit" name="editPosition" value="" class="edit" title="Edit" />
	 										<input type="submit" name="addCandidate" value="" class="addCandidate" title="Add Candidate" />
	 									</c:if>
	 									<c:if test="${position.isClosed == true}">
											<input type="submit" name="clonePosition" value="" class="clone" title="Reuse" />
										</c:if>
										
										<!-- <input type="submit" name="deletePosition" value="" class="delete" title="Delete" onclick="return confirm('Are you sure you want to delete?')"/> -->
									</form>
									</div>
								</td>
							</tr>
						</c:forEach>
					</table>
				</div>
			</div>
		</div>
	</div>

</body>
</html>